package com.twoGroup.boot.service.imp;


import com.twoGroup.boot.mapper.ClientMapper;
import com.twoGroup.boot.pojo.GoodsAndShopAndGoodsTypeAndGoodsBrand;
import com.twoGroup.boot.pojo.GoodsImg;
import com.twoGroup.boot.pojo.ShopAndGoods;
import com.twoGroup.boot.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ClientServiceImp implements ClientService {
    @Autowired
    private ClientMapper clientMapper;

    //客户在购物车页面通过点击店铺也就是通过id查询到该店铺和店铺下的商品
    public List<ShopAndGoods> findGoodsByClickShopId(int shopId) {
        List<ShopAndGoods> list = clientMapper.findGoodsByClickShopId(shopId);
        return list;
    }

    @Override
    public List<GoodsImg> findGoodsImgByGoodsId(int goodsId) {
        List<GoodsImg> goodsImgs = clientMapper.findGoodsImgById(goodsId);
        return goodsImgs;
    }

    @Override
    public Map<String,Object> queryGoodsByGoodsId(int goodsId) {
        Map<String, Object> map = clientMapper.queryGoodsById(goodsId);
        return map;
    }
}
